package com.doit.demo06;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

//定时器
public class test {
    public static void main(String[] args) {
       Timer t =new Timer();
       t.schedule(new TimerTask() {
           @Override
           public void run() {
               System.out.println("吃饭时间到");
           }
       },new Date(),4000);
    }
}
